package com.tengju.activity.infrastructure.repository.convert;

import com.tengju.activity.domain.model.activity.ActivityConfig;
import com.tengju.activity.domain.model.activity.ActivitySignUp;
import com.tengju.activity.infrastructure.persistence.mybatis.dataobject.ActivityConfigDO;
import com.tengju.activity.infrastructure.persistence.mybatis.dataobject.ActivitySignUpDO;

import java.time.LocalDateTime;

public class ActivitySignUpConvert {

    public static ActivitySignUpDO convertToDo(ActivitySignUp activitySignUp) {
        ActivitySignUpDO activitySignUpDO = new ActivitySignUpDO();
        activitySignUpDO.setActivityId(activitySignUp.getActivityId().getValue());
        activitySignUpDO.setIdCode(activitySignUp.getIdCode().getValue());
        return activitySignUpDO;
    }

    public static ActivityConfigDO convertToDo(ActivityConfig activityConfig) {
        ActivityConfigDO activityConfigDO = new ActivityConfigDO();
        activityConfigDO.setActivityId(activityConfig.getActivityId().getValue());
        activityConfigDO.setActivityCode(activityConfig.getActivityCode());
        activityConfigDO.setTitle(activityConfig.getTitle());
        activityConfigDO.setStartTime(activityConfig.getStartTime());
        activityConfigDO.setEndTime(activityConfig.getEndTime());
        activityConfigDO.setCreateBy(activityConfig.getCreateBy());
        activityConfigDO.setUpdateBy(activityConfig.getUpdateBy());
        activityConfigDO.setCreateTime(LocalDateTime.now());
        activityConfigDO.setUpdateTime(LocalDateTime.now());
        return activityConfigDO;
    }


}
